<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017-10-05
 * Time: 22:50
 */

namespace app\Http\Controllers\Wechat;


use App\Http\Controllers\Controller;
use App\Models\WechatUpload;
use Illuminate\Support\Facades\Session;

class HotVideoController extends Controller
{
    public function getIndex()
    {
        $wechatUploads = WechatUpload::query()
            ->where('type', 2)
            ->where('status', 0)
            ->orderBy('buy_count', 'descs')
            ->with('my_wechat_uploads')
            ->paginate(20);
        $openid = Session::get('wechat_openid');
        return view('wechat.hot-video', compact('wechatUploads', 'openid'));
    }
}